﻿using EntityFrameworkCore.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace EntityFrameworkCore.Configurations
{
    public class SysUserConfigurations : EntityFrameworkCore.Mapping.EntityMappingConfiguration<SysUser>
    {
    

        public override void Map(EntityTypeBuilder<SysUser> builder)
        {

            base.MapCommon(builder);
            builder.Property(b => b.UserName).HasColumnType("nvarchar(10)").IsRequired(true);
            builder.Property(b => b.AccountNumber).HasColumnType("nvarchar(10)").IsRequired(true);
            builder.Property(b => b.Password).HasColumnType("nvarchar(10)").IsRequired(true);
            builder.Property(b => b.State).HasDefaultValue(0);
            builder.Property(b => b.Sex).HasDefaultValue(0);
            builder.Property(b => b.Age).IsRequired(false);
            builder.Property(b => b.Remarks).HasColumnType("nvarchar(1000)").IsRequired(false);
            builder.Property(b => b.Icon).HasColumnType("nvarchar(100)").IsRequired(false);
            builder.ToTable("SysUsers");
        }

     
    }
}
